import React,{useState,useEffect} from 'react'
import { BrowserRouter as Router, Route, Routes, useNavigate, useLocation } from 'react-router-dom'
import axios from 'axios'
import './search.css'
export default function Search() {
  let [y_type, setY_type] = useState('')
	let [tofb, setTofb] = useState(false)
	let [list, setList] = useState([])
  const getList = () => {
		let h = -1
		if (tofb == false) {
			h = 1
		} else {
			h = -1
		}
		axios.get(`http://localhost:3000/yi?y_type=${y_type}&tofb=${h}`).then(res => {
			let { code, data } = res.data
			setList(data)
		})
  }
  useEffect(()=>{
    getList()
  },[])
  return (
    <div>
		<nav className='header'>
			<span>&lt;搜索</span>
			<span>···|口</span>
		</nav>
    </div>
  )
}
